package com.itheima.train.bi.service.impl;

import com.itheima.train.bi.mapper.BIMapper;
import com.itheima.train.bi.model.dto.BIGroupCount;
import com.itheima.train.bi.model.query.BIQuery;
import com.itheima.train.bi.service.BIService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Liang
 * @date 2022/7/18/018 14:20
 */
@Service
@RequiredArgsConstructor
public class BIserviceImpl implements BIService {
    private final BIMapper biMapper;

    @Override
    public List<BIGroupCount> findIntegralByTime(BIQuery biQuery) {
        //1总积分、2平均分、3组人数
        switch (biQuery.getType()) {
            case 1:
                return null;
            case 2:
                return new ArrayList<>();
            case 3:
                return biMapper.findIntegralByTime(biQuery);
            default:
                throw new RuntimeException("查询类型不正确");
        }
    }
}
